/* MongoDB schema for Round API model */

var Action = require('./ActionSchema.js').Action,
    mongoose = require('mongoose'),
    Schema = mongoose.Schema;

var RoundSchemaModel = new Schema({
    id           : { type: String, required: true },
    players: {
        hinter: String,
        guesser: String
    },
    guess_target : { type: String, required: true },
    actions : {
        hints   : [Action],
        guesses : [Action]
    },
    points   : Number,
    turn     : String,
    complete : Boolean
});

exports.Round = RoundSchemaModel;

var RoundSchema = exports.RoundSchema = mongoose.model('Round', RoundSchemaModel, 'rounds');
